//
//  CCShareView.m
//  JadeShop
//
//  Created by mac on 2019/5/17.
//  Copyright © 2019年 SZJ.test. All rights reserved.
//

#import "CCShareView.h"
#import "Tool.h"
@implementation CCShareView
{
    NSString *_text;
    NSString *_urlStr;
    UIImage *_image;
}
+(void)shareWithType:(ShareType)shareType withShareData:(ShareData)shareData{
    CCShareView *view = [[NSBundle mainBundle] loadNibNamed:@"CCShareView" owner:nil options:nil].firstObject;
    view.frame = YYScreenBounds();
    NSString *text;
    NSString *urlStr;
    UIImage *image;
    shareData(&text,&urlStr,&image);
    if (text) {
        view->_text = text;
    }
    if (urlStr) {
        view->_urlStr = urlStr;
    }
    if (image) {
        view->_image = image;
    }
    
    [[UIApplication sharedApplication].keyWindow addSubview:view];
    
}

@end
